<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
  <head>
    <meta charset="UTF-8">
    <title>母婴咨询</title>
    <link rel="stylesheet" type="text/css" href="/res/static/css/main.css">
    <link rel="stylesheet" type="text/css" href="/res/layui/css/layui.css">

    <script type="text/javascript" src="/res/layui/layui.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.1, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">

  </head>
  <body>
    <div>
        <div class="site-nav-bg">
          <div class="site-nav w1200">
            <p class="sn-back-home">
              <i class="layui-icon layui-icon-home"></i>
              <a href="/index" >首页</a>
            </p>
            <div class="sn-quick-menu">
              <div>
                <li class="layui-nav-item" lay-unselect="">
                  <div id="">
                    <div style="margin-right: 5px">
                      <img id="userImg" th:if="${session.userImg != null}"  th:src="${session.userImg}"  class="layui-nav-img">
                    </div>
                    <div id="username" style="color: crimson;margin-right: 6px;font-size: 24px" th:text="${session.userName}"></div>

                  </div>
                  <!--<dl class="layui-nav-child">-->
                  <!--<dd><a href="javascript:;">修改信息</a></dd>-->
                  <!--<dd><a href="javascript:;">安全管理</a></dd>-->
                  <!--<dd><a href="javascript:;">退了</a></dd>-->
                  <!--</dl>-->
                </li>
              </div>
              <div class="login"><a href="/login.html"><p th:text="${session.userName!=null?'':'登录'}"></p>&nbsp;&nbsp;</a></div>
              <div class="sp-cart"><a style="color:coral;margin-right: 6px;font-size: 15px" href="/myself">个人中心&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></div>
              <div class="sp-cart"><a style="color: coral;margin-right: 6px;font-size: 15px" href="/showShopCart">购物车</a><span th:text="${size}"></span></div>
              <div class="sp-cart myorder"><a href="/showOrder">&nbsp;&nbsp;&nbsp;我的订单</a></div>
            </div>
          </div>
        </div>


        <div class="header">
          <div class="headerLayout w1200">
            <div class="headerCon">
              <h1 class="mallLogo">
                <a href="/index" title="母婴商城">
                  <img src="/res/static/img/logo.png">
                </a>
              </h1>
              <div class="mallSearch">
                <form action="/goodsController/indexSearch" class="layui-form" novalidate method="post"  >
                  <input type="text" name="content" required  lay-verify="required"  autocomplete="off" class="layui-input" placeholder="请输入需要的商品">
                  <button class="layui-btn" lay-submit lay-filter="formDemo" type="submit">
                    <i class="layui-icon layui-icon-search"></i>
                  </button>
                  <input type="hidden" name="" value="">
                </form>
              </div>
            </div>
          </div>
        </div>

        <div class="content content-nav-base information-content">
          <div class="main-nav">
            <div class="inner-cont0">
              <div class="inner-cont1 w1200">
                <div class="inner-cont2">
                  <a href="/show">所有商品</a>
                  <a href="/bulk">今日折扣</a>
                  <a href="information.html"  class="active">母婴资讯</a>
                  <a href="about.html">关于我们</a>
                </div>
              </div>
            </div>
          </div>

          <div class="info-list-box">
            <div class="info-list w1200">
              <div class="item-box layui-clear" id="list-cont" >
                  <div class="item" th:each="tb:${list}">
                    <div class="img">
                      <img style="height: 250px;width: 250px;"  th:src="${tb.consultImgUrl}" alt="婴儿图片baby">
                    </div>
                    <div class="text">
                      <h4 th:text="${tb.consultQuestion}"> </h4>
                      <p class="data" th:text="${tb.consultDate}"></p>
                      <p class="info-cont" th:text="${tb.consultAnswer}"></p>
                    </div>
                  </div>
              </div>
            </div>
          </div>
       <div id="demo0" style="text-align: center;"></div>

    </div>
      <script>
        layui.config({
          base: '/res/static/js/util/' //你存放新模块的目录，注意，不是layui的模块目录
        }).use(['mm','laypage'],function() {
          laypage = layui.laypage;
          laypage.render({
            url:"/information"
            ,elem: 'demo0'
            ,page:true
            ,limit:4
            ,curr:[[${nowpage}]]
            ,count: [[${count}]] //数据总数
            ,jump: function(obj,first){
              if (!first){
                var curr = obj.curr;
                location.href="/information?nowpage="+curr;
              }
            }
          });
          // 模版引擎导入
          // var html = demo.innerHTML;
          // var listCont = document.getElementById('list-cont');
          //  mm.request({
          //    url: '../json/information.json',
          //    success : function(res){
          //      console.log(res)
          //      listCont.innerHTML = mm.renderHtml(html,res)
          //    },
          //    error: function(res){
          //      console.log(res);
          //    }
          //  })
        });
      </script>
  </body>
</html>